package 蓝桥._14届.棋盘;

import java.util.Scanner;
// 1:无需package
// 2: 类名必须Main, 不可修改

public class Main2 {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        //在此输入您的代码...
        // 0:白 ，1：黑
        // 二维差分数组
        int n = scan.nextInt();
        int m = scan.nextInt();

        int[][] t = new int[n][n];
        for(int i=0;i<m;i++){
            int x1 = scan.nextInt() - 1;
            int y1 = scan.nextInt() - 1;
            int x2 = scan.nextInt() - 1;
            int y2 = scan.nextInt() - 1;
            for (int j = x1; j <= x2; j++) {
                for (int k = y1; k <= y2; k++) {
                    t[j][k]++;
                }
            }
        }
        for (int i = 0; i < n; i++) {
            for (int j = 0; j < n; j++) {
                System.out.print(t[i][j]%2);
            }
            System.out.print("\n");
        }


        scan.close();
    }
}